import java.util.HashMap;
import java.util.Map;
public class Solution {
    public int[] twoSum(int[] numbers, int target) {
        // Start typing your Java solution below
        // DO NOT write main() function
        int size = numbers.length;
        int[] res = new int[2];
        if (size < 1) {
            res[0] = 0;
            res[1] = 0;
            return res;
        }
        
        Map<Integer, Integer> numMap = new HashMap<Integer, Integer>();
        for (int i =0; i< size; i++) {
            if(numMap.containsKey(target - numbers[i])) {
                res[0] = numMap.get(target - numbers[i]);
                res[1] = i+1;
                return res;
            } else {
                numMap.put(numbers[i], i+1);
            }
        }
        return res;
    }
}
